package {

	import net.box2fp.Box2DEntity;
	import net.box2fp.graphics.SuperGraphiclist;
	import net.flashpunk.graphics.Image;
	import Box2D.Dynamics.b2Body;
	import net.box2fp.Box2DShapeBuilder;

	public class MyBox2DEntity extends Box2DEntity {
		
		[Embed(source = "assets/ball.png")]
		public const Ball:Class;
		private var ball:Image = new Image(Ball);
		
		public function MyBox2DEntity(x:Number,y:Number) {
			
			//graphic = ball;
			super(x, y, 50, 50, b2Body.b2_dynamicBody);
			(graphic as SuperGraphiclist).add(ball);
		}
		
		override public function buildShapes(friction:Number, density:Number, restitution:Number, group:int, category:int, collmask:int):void {
			
			Box2DShapeBuilder.buildCircle(body, width / (2.0 * box2dworld.scale));
		}
		
		override public function update():void {
			super.update();
		}
	}	

}	